﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Documents.Common.Interfaces;
using Documents.Common.Helpers;

namespace Documents.web.Helpers
{
    public class NWISPasHelper : IPasHelper
    {
        private string _pasrepositoryurl = "http://localhost:2204";
        #region IPasHelper Members

        public System.Xml.XmlDocument GetPatient(string subjectIdentifiers)
        {
            return XmlHelper.Get(_pasrepositoryurl + "/Patient/"+subjectIdentifiers);
        }

        public System.Xml.XmlDocument InPatients(string wardCode, string dateFrom, string dateTo)
        {
            string url = string.Format("{0}/Patient/InPatients/?wardCode={1}&dateFrom={2}&dateTo={3}", _pasrepositoryurl, wardCode, dateFrom, dateTo);
            return XmlHelper.Get(url);
        }

        public System.Xml.XmlDocument Locations()
        {
            string url = string.Format("{0}/Locations/", _pasrepositoryurl);
            return XmlHelper.Get(url);
        }

        public System.Xml.XmlDocument Discharges(string wardCode, string dateFrom, string dateTo)
        {
            string url = string.Format("{0}/Patient/Discharges/?wardCode={1}&dateFrom={2}&dateTo={3}", _pasrepositoryurl, wardCode, dateFrom, dateTo);
            return XmlHelper.Get(url);
        }

        #endregion
    }
}
